package com.frinder.data.base;

import lombok.Data;

import java.util.List;

/**
 * @ClassName PageInfo
 * @Description 分页类
 * @Author frinder
 * @Date 2020/8/6 14:13
 * @Verion 1.0
 */
@Data
public class PageInfo<T> {
    private int pageNum;
    private int pageSize;
    private long total;
    private int pages;
    private List<T> list;

    public void setTotal(long total) {
        this.total = total;
        this.pages = (int) (total + pageSize - 1) / pageSize;
    }
}
